package models

import (
	"time"
)

type Ticket struct {
	TicketId     uint      `xorm:"ticket_id notnull int pk autoincr"`
	MasterId     uint      `xorm:"master_id notnull int" valid:"required,uint32"`
	Subject      string    `xorm:"subject notnull varchar(50)" valid:"required,length(1|50)"`
	Content      string    `xorm:"content notnull text" valid:"required,length(1|65535)"`
	UserId       uint      `xorm:"user_id notnull int" valid:"required,uint32"`
	ReviewerId   uint      `xorm:"reviewer_id notnull int" valid:"required,uint32"`
	Status       uint8     `xorm:"status notnull int" valid:"required,matches(^\d$)"` // TODO:
	CreationDate time.Time `xorm:"creation_date notnull datetime"`
}

func (t *Ticket) TableName() string {
	return "mm_tickets"
}
